<template>
  <a-modal
    :title="title"
    :width="1000"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">

        <a-tab-pane tab="自动脱敏详情表" key="1" :forceRender="true">
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :loading="loading"
            :columns="columns"
            :dataSource="dataSource"
            :pagination="ipagination"
            @change="handleTableChange"></a-table>
        </a-tab-pane>

    </a-spin>
  </a-modal>
</template>

<script>
  import { httpAction, getAction,postAction } from '@/api/manage'
  import { FormTypes, VALIDATE_NO_PASSED, getRefPromise, validateFormAndTables } from '@/utils/JEditableTableUtil'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  export default {

    name: 'ShowFieldinfoModal',
    mixins: [JeecgListMixin],

    data() {
      return {

        visible: false,
        model: {},
        fdTableId:{},
        pageNo:{},
        pageSize:{},
        disableSubmit: true,
        //编辑信息
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: "center",
            customRender: function(t, r, index) {
              return parseInt(index) + 1;
            }
          },
       /*   {
            title: '表id',
            align: "center",
            dataIndex: 'fdTableid'
          },
          {
            title: '字段id',
            align: "center",
            dataIndex: 'fdFieldid'
          },*/
          {
            title: '字段名',
            align: "center",
            dataIndex: 'fdFieldname'
          },
          {
            title: '描述',
            align: "center",
            dataIndex: 'fdFielddesc'
          },
          {
            title: '字段类型',
            align: "center",
            dataIndex: 'fdFieldtype'
          },
          {
            title: '字段长度',
            align: "center",
            dataIndex: 'fdFieldlength'
          },
          {
            title: '字段精度',
            align: "center",
            dataIndex: 'fdFieldscale'
          },
          {
            title: '状态',
            align: "center",
            dataIndex: 'fdStatus_dictText'
          },
          {
            title: '规则名称',
            align: "center",
            dataIndex: 'fdRulename'
          },
          {
            title: '规则等级',
            align: "center",
            dataIndex: 'fdRulelevel'
          },

        ],


        confirmLoading: false,
        selectedRows: [],
        url: {
          list: '/rule/autossc/showFieldinfo'
        }
      }
    },

    created() {
    },
    methods: {
      edit(fdTableId) {
        this.visible = true;
        this.activeKey = '1'
        console.log(this.url);
        // this.model = Object.assign({}, record)
        // 加载子表数据
       this.fdTableId = { fdTableId: fdTableId }
        this.loadData(fdTableId)

      },
        //查询某个tab的数据
      loadData( ) {
        this.loading = true
        var param = this.getQueryParams();
        var params = {pageNo:param.pageNo,pageSize:param.pageSize,fdTableId:this.fdTableId.fdTableId};
        getAction(this.url.list, params).then(res => {
          console.log(params)
          this.dataSource = res.result.records || [];
          this.ipagination.total = res.result.total;
        }).finally(() => {
          this. loading = false
        })
      },
      handleCancel() {
        this.close()
      },
      close() {
        this.visible = false
        this.$emit('close')
      },
    }
  }
</script>

<style lang="less" scoped>

</style>